<template>
   <div>
      <button @click="getUserInfo">获取用户信息</button>
      <button @click="getAuthMenu">获取权限信息</button>
   </div>
</template>

<script>
import request from '@/utils/request'
export default {
    methods:{
        async getUserInfo(){
            const result=await request({
                method:'GET',
                url:'/users/getUserInfo',
                // headers:{
                //     'Authorization':"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MGQxNzQ3NTg4MDk0YWFjYjQyOTJlYjIiLCJpYXQiOjE2OTQ3NDM4MDQsImV4cCI6MTY5NDc0NTYwNH0.EH55eMTRnXzRCcecQvRwn3s0JKRaRUM4XQlJeiuveOU"
                // }
            }).catch(err=>{
                console.log('出错了');
            })
           
        },
        async getAuthMenu(){
           const result=await request.get('/menus/getAuthMenus',{
                // headers:{
                //      'Authorization':"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MGQxNzQ3NTg4MDk0YWFjYjQyOTJlYjIiLCJpYXQiOjE2OTQ3NDM4MDQsImV4cCI6MTY5NDc0NTYwNH0.EH55eMTRnXzRCcecQvRwn3s0JKRaRUM4XQlJeiuveOU"
                // }
            })
            console.log(result.data);
        }
    }
}
</script>

<style>

</style>